
package Kasir;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.LineBorder;

public class Loading extends JFrame {

    private JLabel label;
    private JProgressBar pb;
    private JPanel pn,  pn1;

    public Loading() {
        setLayout(new GridLayout(3, 1));
        setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        int a = 0;
        setLocationRelativeTo(null);

        pn = new JPanel(new FlowLayout());
        add(pn);

        label = new JLabel("SMARTCASH SYSTEM");
        label.setFont(new Font("Times New Roman", 1, 30));
        add(label);

        pn1 = new JPanel(new BorderLayout());
        add(pn1);
        pb = new JProgressBar();
        Color warna = Color.BLUE;
        pb.setValue(0);
        pb.setPreferredSize(new Dimension(100, 15));
        pb.setBackground(Color.BLUE);
        pb.setForeground(Color.magenta);
        pb.setStringPainted(true);
        pb.setBorder(new LineBorder(warna, 1));
        pn1.add(pb, BorderLayout.SOUTH);
        pack();
      


        setDefaultCloseOperation(3);
        while (a <= 100) {
            pb.setValue(a);
            
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
            }
            a++;
        }
        new LoginForm().setVisible(true);
        dispose();
    }

}


